3.106 \(\int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+c x^2}} \, dx\)

Optimal. Leaf size=168 \[ -\frac {\sqrt {a+c x^2} \left (d h^2-e g h+f g^2\right )}{h (g+h x) \left (a h^2+c g^2\right )}+\frac {\tanh ^{-1}\left (\frac {a h-c g x}{\sqrt {a+c x^2} \sqrt {a h^2+c g^2}}\right ) \left (a h^2 (2 f g-e h)+c \left (f g^3-d g h^2\right )\right )}{h^2 \left (a h^2+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{\sqrt {c} h^2} \]

[Out]

(a*h^2*(-e*h+2*f*g)+c*(-d*g*h^2+f*g^3))*arctanh((-c*g*x+a*h)/(a*h^2+c*g^2)^(1/2)/(c*x^2+a)^(1/2))/h^2/(a*h^2+c
*g^2)^(3/2)+f*arctanh(x*c^(1/2)/(c*x^2+a)^(1/2))/h^2/c^(1/2)-(d*h^2-e*g*h+f*g^2)*(c*x^2+a)^(1/2)/h/(a*h^2+c*g^
2)/(h*x+g)

________________________________________________________________________________________

Rubi [A]  time = 0.23, antiderivative size = 168, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {1651, 844, 217, 206, 725} \[ -\frac {\sqrt {a+c x^2} \left (d h^2-e g h+f g^2\right )}{h (g+h x) \left (a h^2+c g^2\right )}+\frac {\tanh ^{-1}\left (\frac {a h-c g x}{\sqrt {a+c x^2} \sqrt {a h^2+c g^2}}\right ) \left (a h^2 (2 f g-e h)+c \left (f g^3-d g h^2\right )\right )}{h^2 \left (a h^2+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{\sqrt {c} h^2} \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2)/((g + h*x)^2*Sqrt[a + c*x^2]),x]

[Out]

-(((f*g^2 - e*g*h + d*h^2)*Sqrt[a + c*x^2])/(h*(c*g^2 + a*h^2)*(g + h*x))) + (f*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c
*x^2]])/(Sqrt[c]*h^2) + ((a*h^2*(2*f*g - e*h) + c*(f*g^3 - d*g*h^2))*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*h^2
]*Sqrt[a + c*x^2])])/(h^2*(c*g^2 + a*h^2)^(3/2))

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 725

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rule 844

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rule 1651

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, d
 + e*x, x], R = PolynomialRemainder[Pq, d + e*x, x]}, Simp[(e*R*(d + e*x)^(m + 1)*(a + c*x^2)^(p + 1))/((m + 1
)*(c*d^2 + a*e^2)), x] + Dist[1/((m + 1)*(c*d^2 + a*e^2)), Int[(d + e*x)^(m + 1)*(a + c*x^2)^p*ExpandToSum[(m
+ 1)*(c*d^2 + a*e^2)*Q + c*d*R*(m + 1) - c*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, c, d, e, p}, x] && Po
lyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+c x^2}} \, dx &=-\frac {\left (f g^2-e g h+d h^2\right ) \sqrt {a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}-\frac {\int \frac {-c d g+a f g-a e h-f \left (\frac {c g^2}{h}+a h\right ) x}{(g+h x) \sqrt {a+c x^2}} \, dx}{c g^2+a h^2}\\ &=-\frac {\left (f g^2-e g h+d h^2\right ) \sqrt {a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}+\frac {f \int \frac {1}{\sqrt {a+c x^2}} \, dx}{h^2}+\frac {\left (c d g-2 a f g-\frac {c f g^3}{h^2}+a e h\right ) \int \frac {1}{(g+h x) \sqrt {a+c x^2}} \, dx}{c g^2+a h^2}\\ &=-\frac {\left (f g^2-e g h+d h^2\right ) \sqrt {a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}+\frac {f \operatorname {Subst}\left (\int \frac {1}{1-c x^2} \, dx,x,\frac {x}{\sqrt {a+c x^2}}\right )}{h^2}-\frac {\left (c d g-2 a f g-\frac {c f g^3}{h^2}+a e h\right ) \operatorname {Subst}\left (\int \frac {1}{c g^2+a h^2-x^2} \, dx,x,\frac {a h-c g x}{\sqrt {a+c x^2}}\right )}{c g^2+a h^2}\\ &=-\frac {\left (f g^2-e g h+d h^2\right ) \sqrt {a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}+\frac {f \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (c d g-2 a f g-\frac {c f g^3}{h^2}+a e h\right ) \tanh ^{-1}\left (\frac {a h-c g x}{\sqrt {c g^2+a h^2} \sqrt {a+c x^2}}\right )}{\left (c g^2+a h^2\right )^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.36, size = 218, normalized size = 1.30 \[ \frac {-\frac {h \sqrt {a+c x^2} \left (h (d h-e g)+f g^2\right )}{(g+h x) \left (a h^2+c g^2\right )}+\frac {\log \left (\sqrt {a+c x^2} \sqrt {a h^2+c g^2}+a h-c g x\right ) \left (a h^2 (2 f g-e h)+c \left (f g^3-d g h^2\right )\right )}{\left (a h^2+c g^2\right )^{3/2}}+\frac {\log (g+h x) \left (a h^2 (e h-2 f g)+c \left (d g h^2-f g^3\right )\right )}{\left (a h^2+c g^2\right )^{3/2}}+\frac {f \log \left (\sqrt {c} \sqrt {a+c x^2}+c x\right )}{\sqrt {c}}}{h^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2)/((g + h*x)^2*Sqrt[a + c*x^2]),x]

[Out]

(-((h*(f*g^2 + h*(-(e*g) + d*h))*Sqrt[a + c*x^2])/((c*g^2 + a*h^2)*(g + h*x))) + ((a*h^2*(-2*f*g + e*h) + c*(-
(f*g^3) + d*g*h^2))*Log[g + h*x])/(c*g^2 + a*h^2)^(3/2) + (f*Log[c*x + Sqrt[c]*Sqrt[a + c*x^2]])/Sqrt[c] + ((a
*h^2*(2*f*g - e*h) + c*(f*g^3 - d*g*h^2))*Log[a*h - c*g*x + Sqrt[c*g^2 + a*h^2]*Sqrt[a + c*x^2]])/(c*g^2 + a*h
^2)^(3/2))/h^2

________________________________________________________________________________________

fricas [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+a)^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Check [ab
s(t_nostep)]Error: Bad Argument Type

________________________________________________________________________________________

maple [B]  time = 0.02, size = 923, normalized size = 5.49 \[ -\frac {c d g \ln \left (\frac {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{\left (a \,h^{2}+c \,g^{2}\right ) \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, h}+\frac {c e \,g^{2} \ln \left (\frac {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{\left (a \,h^{2}+c \,g^{2}\right ) \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, h^{2}}-\frac {c f \,g^{3} \ln \left (\frac {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{\left (a \,h^{2}+c \,g^{2}\right ) \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, h^{3}}-\frac {\sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, d}{\left (a \,h^{2}+c \,g^{2}\right ) \left (x +\frac {g}{h}\right )}+\frac {\sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, e g}{\left (a \,h^{2}+c \,g^{2}\right ) \left (x +\frac {g}{h}\right ) h}-\frac {\sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, f \,g^{2}}{\left (a \,h^{2}+c \,g^{2}\right ) \left (x +\frac {g}{h}\right ) h^{2}}-\frac {e \ln \left (\frac {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{\sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, h^{2}}+\frac {2 f g \ln \left (\frac {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\frac {2 a \,h^{2}+2 c \,g^{2}}{h^{2}}+2 \sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, \sqrt {-\frac {2 \left (x +\frac {g}{h}\right ) c g}{h}+\left (x +\frac {g}{h}\right )^{2} c +\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{\sqrt {\frac {a \,h^{2}+c \,g^{2}}{h^{2}}}\, h^{3}}+\frac {f \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{\sqrt {c}\, h^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+a)^(1/2),x)

[Out]

f/h^2*ln(c^(1/2)*x+(c*x^2+a)^(1/2))/c^(1/2)-1/(a*h^2+c*g^2)/(x+g/h)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+(a*h^2+c*g^2
)/h^2)^(1/2)*d+1/h/(a*h^2+c*g^2)/(x+g/h)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+(a*h^2+c*g^2)/h^2)^(1/2)*e*g-1/h^2/(a*h
^2+c*g^2)/(x+g/h)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+(a*h^2+c*g^2)/h^2)^(1/2)*f*g^2-1/h*c*g/(a*h^2+c*g^2)/((a*h^2+c
*g^2)/h^2)^(1/2)*ln((-2*(x+g/h)*c*g/h+2*(a*h^2+c*g^2)/h^2+2*((a*h^2+c*g^2)/h^2)^(1/2)*(-2*(x+g/h)*c*g/h+(x+g/h
)^2*c+(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h))*d+1/h^2*c*g^2/(a*h^2+c*g^2)/((a*h^2+c*g^2)/h^2)^(1/2)*ln((-2*(x+g/h)*
c*g/h+2*(a*h^2+c*g^2)/h^2+2*((a*h^2+c*g^2)/h^2)^(1/2)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+(a*h^2+c*g^2)/h^2)^(1/2))/
(x+g/h))*e-1/h^3*c*g^3/(a*h^2+c*g^2)/((a*h^2+c*g^2)/h^2)^(1/2)*ln((-2*(x+g/h)*c*g/h+2*(a*h^2+c*g^2)/h^2+2*((a*
h^2+c*g^2)/h^2)^(1/2)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h))*f-1/h^2/((a*h^2+c*g^2)/
h^2)^(1/2)*ln((-2*(x+g/h)*c*g/h+2*(a*h^2+c*g^2)/h^2+2*((a*h^2+c*g^2)/h^2)^(1/2)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+
(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h))*e+2/h^3/((a*h^2+c*g^2)/h^2)^(1/2)*ln((-2*(x+g/h)*c*g/h+2*(a*h^2+c*g^2)/h^2+
2*((a*h^2+c*g^2)/h^2)^(1/2)*(-2*(x+g/h)*c*g/h+(x+g/h)^2*c+(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h))*f*g

________________________________________________________________________________________

maxima [B]  time = 0.58, size = 419, normalized size = 2.49 \[ -\frac {\sqrt {c x^{2} + a} f g^{2}}{c g^{2} h^{2} x + a h^{4} x + c g^{3} h + a g h^{3}} + \frac {\sqrt {c x^{2} + a} e g}{c g^{2} h x + a h^{3} x + c g^{3} + a g h^{2}} - \frac {\sqrt {c x^{2} + a} d}{c g^{2} x + a h^{2} x + \frac {c g^{3}}{h} + a g h} + \frac {f \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {c} h^{2}} + \frac {c f g^{3} \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{{\left (a + \frac {c g^{2}}{h^{2}}\right )}^{\frac {3}{2}} h^{5}} - \frac {c e g^{2} \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{{\left (a + \frac {c g^{2}}{h^{2}}\right )}^{\frac {3}{2}} h^{4}} + \frac {c d g \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{{\left (a + \frac {c g^{2}}{h^{2}}\right )}^{\frac {3}{2}} h^{3}} - \frac {2 \, f g \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{\sqrt {a + \frac {c g^{2}}{h^{2}}} h^{3}} + \frac {e \operatorname {arsinh}\left (\frac {c g x}{\sqrt {a c} {\left | h x + g \right |}} - \frac {a h}{\sqrt {a c} {\left | h x + g \right |}}\right )}{\sqrt {a + \frac {c g^{2}}{h^{2}}} h^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

-sqrt(c*x^2 + a)*f*g^2/(c*g^2*h^2*x + a*h^4*x + c*g^3*h + a*g*h^3) + sqrt(c*x^2 + a)*e*g/(c*g^2*h*x + a*h^3*x
+ c*g^3 + a*g*h^2) - sqrt(c*x^2 + a)*d/(c*g^2*x + a*h^2*x + c*g^3/h + a*g*h) + f*arcsinh(c*x/sqrt(a*c))/(sqrt(
c)*h^2) + c*f*g^3*arcsinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/((a + c*g^2/h^2)^(3/2
)*h^5) - c*e*g^2*arcsinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/((a + c*g^2/h^2)^(3/2)
*h^4) + c*d*g*arcsinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/((a + c*g^2/h^2)^(3/2)*h^
3) - 2*f*g*arcsinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/(sqrt(a + c*g^2/h^2)*h^3) +
e*arcsinh(c*g*x/(sqrt(a*c)*abs(h*x + g)) - a*h/(sqrt(a*c)*abs(h*x + g)))/(sqrt(a + c*g^2/h^2)*h^2)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {f\,x^2+e\,x+d}{{\left (g+h\,x\right )}^2\,\sqrt {c\,x^2+a}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x + f*x^2)/((g + h*x)^2*(a + c*x^2)^(1/2)),x)

[Out]

int((d + e*x + f*x^2)/((g + h*x)^2*(a + c*x^2)^(1/2)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {d + e x + f x^{2}}{\sqrt {a + c x^{2}} \left (g + h x\right )^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)/(h*x+g)**2/(c*x**2+a)**(1/2),x)

[Out]

Integral((d + e*x + f*x**2)/(sqrt(a + c*x**2)*(g + h*x)**2), x)

________________________________________________________________________________________